package com.duruikang.LeaveAPI.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.duruikang.LeaveAPI.dao.SortDao;
import com.duruikang.LeaveAPI.entity.Sort;
import com.duruikang.LeaveAPI.service.SortService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author szh
 */
@Service
public class SortServiceImpl extends ServiceImpl<SortDao, Sort> implements SortService {

    @Override
    public Sort getSortByName(String name) {
        return query().eq("name", name).one();
    }

    @Override
    public List<Sort> getLevelList(int type) {
        return query().eq("type", type).orderByDesc("value").list();
    }
}
